package q.test0421library.Moudle;

import lombok.Data;

@Data
public class Result<T> {

    private ResultStatus resultStatus;
    private String errorMessage;
    private T data;


   public static <T> Result success(T data){
       Result result=new Result();
       result.setResultStatus(ResultStatus.SUCCESS);
       result.setData(data);
       return result;
   }

    public static <T> Result unlogin(){
        Result result=new Result();
        result.setResultStatus(ResultStatus.UNLOGIN);
        result.setErrorMessage("登入失败");
        return result;
    }


    public static <T> Result falt(String message){
        Result result=new Result();
        result.setResultStatus(ResultStatus.FALT);
        result.setErrorMessage(message);
        return result;
    }


}  
